GEM5_SIMULATOR   =  ./build/RISCV/gem5.opt

DEBUGFLAGS 		+= 	--debug-flags=HWPrefetch \
			 		--debug-file=trace.out \
          
BOOMFLAGS     += configs/example/se.py \
          --cpu-type=RiscvO3CPU \
          --bp-type=BiModeBP \
          --caches \
          --l2cache \
          --l3cache \
          --cacheline=64 \
          --num-l2cache=1 \
          --l1i_size=32kB \
          --l1i_assoc=8 \
          --l1d_size=32kB \
          --l1d_assoc=8 \
          --l2_size=512kB \
          --l2_assoc=8 \
          --l3_size=8MB \
          --l3_assoc=16 \
          --mem-size=8192MB \
          --l1d-hwp-type=StridePrefetcher\

# BIN=$1 
ATTACk_HOME=/home/jiangfang/workspace/attack_home/my_attack/spectre_on_gem5/bin

debug-smix:
	$(GEM5_SIMULATOR) $(DEBUGFLAGS) $(BOOMFLAGS) --cmd=$(ATTACk_HOME)/smix.riscv

smix:
	$(GEM5_SIMULATOR)  $(BOOMFLAGS) --cmd=$(ATTACk_HOME)/smix.riscv
# check !!! dcache.prefetcher.registerTLB(system.cpu[i].mmu.dtb)
prefetchAttack:
	$(GEM5_SIMULATOR) $(DEBUGFLAGS) $(BOOMFLAGS) --cmd=$(ATTACk_HOME)/prefetchAttack.riscv

spAttack2:
	$(GEM5_SIMULATOR) $(DEBUGFLAGS) $(BOOMFLAGS) --cmd=$(ATTACk_HOME)/SpectrePrefetchV21.riscv

# build gem5.opt
build:
	scons $(GEM5_SIMULATOR) -j17
